import * as api from '@/api/home/homepage.js'

export default {
    namespaced: true,
    state: {
        userList: {}
    },
    mutations: {
        set_UserList(state, value) {
            state.userList = value
        }
    },
    actions: {
        async updatedUserList(cxt, id) {
            await api.getUserList(id)
                .then((res) => {
                    // console.log(res);
                    cxt.commit('set_UserList', res.data.data)
                })
                .catch((err) => {
                    // console.dir(err)
                    this.$message({
                        type: 'info',
                        message: '请求出错!'
                    })
                })
        }

    }

}